﻿package 
{
	import flash.display.*;
	import flash.net.*;
	import flash.events.*;
	import flash.filters.*;
	public class Main extends Sprite
	{
		public function Main()
		{
			init();
		}
		private function init():void
		{
			var loader:Loader=new Loader();
			loader.contentLoaderInfo.addEventListener(Event.COMPLETE,onLoadComplete);
			loader.load(new URLRequest("1.jpg"));
		}
		private function onLoadComplete(event:Event):void
		{
			event.currentTarget.removeEventListener(Event.COMPLETE,onLoadComplete);
			var bitmap:Bitmap=Bitmap(event.currentTarget.content);
			
			var bottomShape:Shape=new Shape();
			bottomShape.x=stage.stageWidth/2;
			bottomShape.y=stage.stageHeight/2;
			bottomShape.filters=[new DropShadowFilter(4,45,0.5,3,3)];
			addChild(bottomShape);
			bottomShape.graphics.lineStyle(0);
			bottomShape.graphics.beginFill(0xffffff,0.8);
			bottomShape.graphics.drawCircle(0,0,204);
			bottomShape.graphics.endFill();

			addChild(bitmap);
			bitmap.x=-100;
			drawCD(bitmap);
		}
		private function drawCD(image:Bitmap):void
		{
			var maskShape:Shape=new Shape();
			maskShape.x=stage.stageWidth/2;
			maskShape.y=stage.stageHeight/2;
			maskShape.filters=[new DropShadowFilter()];
			addChild(maskShape);
			maskShape.graphics.lineStyle(0);
			maskShape.graphics.beginFill(0);
			maskShape.graphics.drawCircle(0,0,200);
			maskShape.graphics.endFill();

			image.mask=maskShape;


			var shapeB:Shape=new Shape();
			shapeB.x=stage.stageWidth/2;
			shapeB.y=stage.stageHeight/2;
			addChild(shapeB);
			//shapeB.graphics.lineStyle(0);
			shapeB.graphics.beginFill(0x333333);
			shapeB.graphics.drawCircle(0,0,30);
			shapeB.graphics.endFill();

			shapeB.graphics.beginFill(0x999999,0.3);
			shapeB.graphics.lineStyle(0,0x999999);
			shapeB.graphics.drawCircle(0,0,50);
			shapeB.graphics.drawCircle(0,0,52);
			shapeB.graphics.drawCircle(0,0,70);
			shapeB.graphics.endFill();
			shapeB.graphics.lineStyle(0,0xffffff,0.6);
			shapeB.graphics.drawCircle(0,0,69);
		}
	}
}